Developer Home Contents Search Feedback Support Intel(r)

Intel Architecture Labs
Technology Directory
Technology DirectoryTechnology Directory

IAL Home | Indeo® Software Home | Indeo® Video 5 Indeo® Audio |

Intel Indeo® Video 5

Creating Video Files

With Intel's Indeo video 5 codec, you can compress digital video files, distribute them by CD or the Internet, and then play those compressed files on the destination PC. It is available free of charge to all PC users including developers. Video producers, multimedia software developers, and Internet Web site authors can distribute the codec royalty-free to end users. If you are an experienced PC video author and would like to jump directly to a list of Indeo video 5.0 tips and tricks, click here.

This document describes how to compress video effectively using Indeo video 5. Read it if you plan to use Indeo video 5 to produce multimedia applications for CD-ROM, or videos to be distributed from a Web site.

NOTE: This paper assumes that you have installed the latest Indeo video drivers, software for video capture and editing (such as Adobe Premiere* or Asymetrix Digital video Producer*), and a supported video playback environment (such as Microsoft's video for Windows* or ActiveMovie*).

This document is divided into the following sections:

Choosing compression settings in your video-editing application
This section discusses choosing the following settings:

Choosing settings in the Indeo Video 5 compression dialog box
This section describes how to choose compression settings specific to Indeo video 5 including:


Editing compressed video
This details the challenges of editing compressed video and describes ways to ensure satisfactory results.

Using transparency without application support
You can read about workarounds for incorporating transparency into your video even if you are using an editing application that does not support this feature directly.

Conclusion
This section summarizes the key points.

Choosing Compression Settings in Your Video Editing Application

Most video editing applications have one or more menus/dialogs in which you set important video compression options, including the target data rate for the compressed file, the video compressor to use, the audio/video interleaving, the key frame interval, and CD-ROM playback preparation.

These are the steps for choosing compression setting. Each step is discussed in detail below.

  1. Select the video compressor.
  2. Set the target data rate or quality level.
  3. Choose an appropriate Audio/Video Interleave ratio.
  4. Set the key frame interval
  5. Disable CD-ROM padding.

Selecting the Video Compression Method
Choose which video encoder compresses the video data (usually under Compression Method). Make sure you have the latest version of Indeo video version 5 on your system.

Setting the Target Data Rate or Quality
Most editing applications provide a selector box called Data Rate, and a numerical entry box into which you enter the average data rate you want in kilobytes (K) per second.

Another control called the Quality slider (typically expressed as a percentage) is usually present, as well. If you enter a nonzero value into the Data Rate box, the Quality slider is ignored. Setting the Data Rate instead of the Quality control results in compressed video files with a nearly constant average data rate from beginning to end, but with varying quality, as the video content becomes easier or harder to compress. Using this setting is appropriate any time you want a specific data rate or file size, as you would for playing from a CD-ROM or streaming over a network of a certain speed.

To use the Data Rate control, select the box and enter a target data rate, expressed in kilobytes-per-second. The encoder attempts to output compressed data at an average data rate as close to the target value as possible. It usually isn't exact, because video files typically vary in compressibility from beginning to end, and the encoder must change quality as needed.

If you do not select the Data Rate, or if you enter a value of zero, the Quality slider is enabled. The higher you set it, the higher the overall data rate and the better the visual quality of the resulting file. Using the Quality slider results in a video file of constant quality from beginning to end. However, with variable data rates, the video content becomes easier or harder to compress. Another benefit of using the Quality slider is speed. The Indeo video 5 encoder runs approximately twice as fast when using the Quality slider. Use this setting any time strict control of the average data rate is not as important (for downloaded video, or other video played from a hard disk). Also use it when you don’t want to vary the quality of a video during playback (to maintain a fixed data rate).

You can obtain a file of approximately the size you want using the Quality slider. It just requires a bit of trial and error. Obtaining a file with the quality level you want is much simpler using the Quality slider. To use the quality slider, position the control at the quality percentage you want (100% is maximum quality, and 0% is minimum quality).

The file size or data rate required to compress a video to some acceptable level of quality varies depending on the content. For example, computer-generated animation sequences consisting of simple backgrounds, low detail, and little motion, usually compress extremely well. However, some video sequences like live sporting events featuring complex backgrounds and lots of motion, require a much higher data rate. The audio data also requires space in the file. This is particularly important to remember when using the Data Rate control, because the required data rate for audio is subtracted directly from the value you enter into the box. Because uncompressed high-quality audio can be quite large (even compared to compressed video), consider using compressed audio when a low data rate is particularly important.

Setting the data rate for maximum CD-ROM performance
Selecting an appropriate data rate is an art that depends on a combination of factors relating to the system performance of the target playback environment. The most important of these is CD-ROM performance. In the past, PC CD-ROM drives were typically 1X drives, theoretically capable of sustained data-transfer rates of only 150 kilobytes-per-second. Fortunately, most PCs today are equipped with CD-ROM drives capable of at least 2X (300 kilobytes-per-second) performance. Most Pentium® processor-based PCs have drives much faster than that. This means that it is no longer critical to maintain a precisely controlled average data rate that is comfortably below 150 kilobytes-per-second. Data rate control is still important for videos with frame sizes larger than 320x240. However, most videos compressed to a reasonable size with Indeo video 5 stream successfully from the CD-ROM drive of any machine with sufficient CPU power to decode the video. This means that usually the CD-ROM drive is no longer the limiting factor. Many developers still use the Data Rate control for CD-ROM applications, but the main reason today is for convenience in achieving a certain file size to save space on the CD-ROM. However, using the Quality slider is becoming more prevalent due to the consistent video quality and faster encoding speed.

Choosing the data rate for maximum Web site performance

Two important factors must be considered in authoring video for the Web:

Determining the average data rate
To determine the average data rate of an existing video file in Windows* 95 or Windows NT* 4.0:
  1. Open the Windows Explorer.
  2. Click the file icon with the right mouse button.
  3. Select Properties.
  4. Click the tab labeled Details and examine the resulting dialog.

Setting Audio/Video Interleaving
The parameter usually named Audio Interleave controls the grouping of audio and video frames on a CD-ROM, hard drive, or Web site. For uncompressed audio, always set the audio interleave to one frame (known as interleaving the file at 1:1). Video frames are often read from the CD-ROM drive one at a time, and while audio can be read from the disk in larger chunks and buffered until it is needed, there is no advantage to doing this. If the audio chunks are too large, the file may play very poorly from CD-ROM. The audio is broken and unsynchronized, and the video may drop frames.

Compressed audio presents a different situation. If you are using compressed audio, the size of the audio chunks will probably be much smaller. So the issues described above are less important. Furthermore, many audio-compression formats do not perform well with audio interleaving set to one frame. This is because these formats require larger chunks of audio to be grouped together in order to obtain good compression. If the audio is then interleaved 1:1, the audio decoder may not have the entire chunk of compressed audio it requires at any given time to play correctly. So you should always interleave compressed audio at a higher rate, like every 1/2 second (the number of frames depends on the video frame rate), or as recommended by your audio codec documentation.

Most video capture applications do not interleave audio and video during capture, so the frames are interleaved at an interval much higher than 1:1. If this is the case, even if you do not wish to recompress the video, you must interleave the audio if you want to put the file on a CD-ROM. Interleave any existing file as follows:

  1. Open the file with a video-editing application.
  2. Set the interleave parameter to 1.
  3. Save the file to disk. If the video is already compressed, make sure you do not recompress it. (See the Editing Compressed Video section for more details.)

Setting the key frame interval.
The key frame interval controls the occurrence of key frames and delta frames within a compressed file. The frequency and location of key frames and delta frames affect a file's video playback performance, quality, and data rate.

To maximize image quality while still maintaining low data rates, Indeo video 5 uses a combination of intraframe and interframe encoding. Key frames are encoded only with respect to themselves; they are essentially still images (similar to JPEG), containing all of the visual information needed to display them. This is intraframe encoding. Delta frames do not contain all of the visual information necessary to display them. Instead, they contain only information representing differences from other frames. This is interframe encoding. Both types of frames are useful, and both have limitations:

The first frame of every video file must be a key frame. After the first frame, the codec places key frames periodically between groups of delta frames to enable random access (seeking) within the file. The key frame interval controls the frequency with which key frames occur. (Indeo video version 5 version also allows developers to place key frames explicitly; for example, at scene changes, or wherever random user access is required.)

An example file using the Indeo video 5 default key frame interval of 15 appears as shown in Figure 1. (Key frames are labeled with a K; delta frames with a D.)

Figure 1. Key Frames and Delta Frames in the Video File


In addition to affecting data rate and random access, the key frame interval also affects playback performance. When you play a video on a system with a slow CPU or CD-ROM drive, the video decode and display can lag behind the audio playback. When this occurs, Video for Windows* tries to speed up the video either by decoding some video frames but not displaying them, or by not decoding them at all. If a frame is neither decoded nor displayed, it is dropped. The effect of dropping a frame depends on:

If a key frame is dropped, every subsequent delta frame is dropped until the next key frame. Files with higher key frame intervals drop more frames. If a delta frame is dropped, the effect varies. Some types of delta frames can be dropped without affecting the decode of any subsequent delta frames. However, other types of delta frames contain information needed by following frames. If one of these delta frames is dropped, some number of frames that follow will be dropped as well. How many frames depends on the type of delta frame dropped and the key frame interval. A key frame interval of one second (equal to the frame rate) usually yields good results for CD-ROM applications.

When authoring for Progressive Download (or any video download application), a key frame interval of 1 to 3 seconds is usually best, as a trade-off between good compression, random access, and playback performance. To ensure that progressively downloaded video plays back smoothly during the lower framerate phases of the download, choose key frame intervals that meet the following criteria:

If these guidelines are not followed, when the video is played during an early download phase at a reduced frame rate (e.g. 5 fps), the key frames may not be spaced evenly with respect to the other frames downloaded to this point, causing the playback to temporarily look jumpy until more levels of the download have arrived. Also note that the key frame interval selected for compressions authored for Progressive Download has an effect on the lowest frame rate (and data rate) achievable in the first download phase. For example, a video clip compressed with a key frame interval of 1 (all key frames) will have a relatively high datarate overall, and will not be able to transmit a lower frame rate in early phases of the progressive download. For network streaming applications, a very high key frame interval (at least 3 to 5 seconds worth of frames) is typically best, to minimize data rate. In this case, key frames are only necessary to provide a re-synchronization point if frames are dropped, since random access is not possible in a streaming file.

When setting a very low key frame interval (less than five), and using the Data Rate control to target a relatively low data rate, you may notice that the compressor does not achieve the requested data rate. This is normal, and means that the data rate requested is too low for the requested key frame interval. This occurs because the encoder gives key frames priority over data rate control. Ordinarily, the encoder drops frames to achieve a requested data rate that is too low to meet, even when compressing frames to the smallest possible size. But the encoder never drops a key frame (because a specific key frame rate or placement was requested). This leads to an impasse if too many key frames are requested with an insufficient data rate. If you encounter this situation, either increase your key frame interval, increase your requested data rate, or decrease your frame resolution to resolve the problem.

You cannot change a compressed file’s key frame interval without recompressing some or all of the file. You must set the key frame interval when you first compress it. If you need to change the key frame interval of a compressed file, recompress the file from the source file for best results.

Selecting CD-ROM padding.
Never use or enable CD-ROM padding when compressing with Indeo video 5, even when authoring for CD-ROM, unless you are specifically authoring for systems with old single-spin (1X) CD-ROM drives. Using this setting for anything else results in reduced quality and increased file size.

CD-ROM padding is null data added to the end of a compressed video frame to adjust its size. Padding rounds the size of each frame up to the next highest multiple of 2 kilobytes. (It doesn't make every frame the same size. After padding, frames still vary in size, but all are an exact multiple of 2 kilobytes.) Originally, this setting supported CD-ROM drives with severe performance penalties when seeking any location that was not on a 2 kilobytes boundary. These drives are no longer commonly used, but the CD-ROM padding setting remains as a vestige of this problem.

The Indeo video 5 Encoder Configuration Dialog Box

Once you have selected Indeo Video Software 5 release as your encoder, a button will be enabled in your editing application that is usually labelled "Configure." Pressing this button takes you to the encoder configuration dialog box. This dialog box includes a variety of special Indeo Video Software 5 release options, which are listed and described below:

Figure 2. Dialog without Quick Compress checked, Showing all options.


Quick Compress
The Quick Compress option allows Indeo Video Software 5 release to encode video many times faster than it would with ordinary offline encoding. Exactly how much faster depends on the content of the source video and the other encoder options you've selected. Choosing Quick Compress automatically disables the Transparency, Viewport Size, and Access Key options, as shown in Figure 2. To run faster, the quick compressor uses a subset of possible compression techniques.

Quick compression trades faster encoding speed for lower image quality and less precise data rate control when you select the Data Rate option in your editing application. When using the Quality slider option, the quick compressor produces files that are larger in size.

The Quick Compress option is ideal for prototyping or previewing video edits, special effects, and other "pencil testing," but use the offline encoder in your final application to obtain the best image quality and compression, or to maintain a more consistent data rate.

Figure 3. The Indeo video 5 Dialog With the Quick Compressor Selected


Scalability
The Scalability option tells the Indeo Video Software 5 release encoder to compress the video using a different set of techniques than it would normally. Clips encoded without Scalability are compressed to provide the very best quality and overall data rate, but without most of the data rate and performance flexibility provided by the scalable mode. Clips encoded with Scalability do not have optimal quality and data rate, although the penalty is small, typically about 10% increased data rate for the same quality. Using Scalability offers a great deal of flexibility in transmission data rate (over a network) and playback performance required on a range of different platforms. In essence, scalability allows one encoded video file to be played back at many different data rates and quality levels, each of which is suitable for different network bandwidths or playback-platform capabilities.

Clips encoded with Scalability are flexible in two ways: frame quality and frame rate. Scalable clips can be played back with three distinct levels of frame quality (called High, Medium and Low). High quality is very similar to the quality of clips without scalability, but at a slightly higher data rate (by 10%). Video played at Medium quality is a little less sharp than High quality, but can be delivered with about 20 to 25% less data rate than High quality. Low quality is noticeably blurrier than High quality, but saves about 40-50% on data rate when compared to High quality.

Likewise, scalable clips can play back at up to four distinct levels of frame rate, depending on the frame rate of the source video. If you encode a video at 30 frames-per-second (fps), with a key frame interval of 30 frames, then frame rate scalability enables playback of that video at 30, 15, 5 and 1 fps, with corresponding reductions in the data rate required to transmit those video clips over a network. Both frame rate and frame quality scalability can be used at the same time, to give even more options for achieving a required data rate from a compressed Indeo video 5 file.

It's important to select Scalability in the Indeo video 5 Encoder Configuration dialog box if you want to enable progressive quality and frame rate for Progressive Downloading. To learn more about this capability, read the Indeo video 5 Progressive Download Publisher tool documentation.

Transparency
The Indeo video 5 codec supports a form of transparency analogous to chroma keying or blue-screening, which allows you to place foreground objects over backgrounds from a source other than the same video clip. This transparency encoding is flexible, allowing for multiple foreground objects of complex shapes. Foreground objects can also move from frame to frame, allowing you to create video sprites which are transparent video objects that can be overlaid on other video or bitmap backgrounds.

Note: For best results using transparency, always provide the Indeo video 5 encoder with original RGB format video such as RGB24 or RGB32 video that was not captured in a chroma subsampled format such as YUV9, YUV12, M-JPEG or encoded in any other compressed format (including Indeo video). This allows the encoder to eliminate the "fringing" or "halo" effect that may otherwise appear around video sprites. Video that has ever been in a compressed or chroma-subsampled format has already been degraded so that the Indeo video 5 encoder can no longer prevent the fringing artifact. The encoder box offers three choices for handling transparency: first frame analysis, alpha channel, or none. Each is detailed below:

Access Key
If you want to restrict compressed video playback to authorized users or applications, use the Indeo video 5's access key feature when you compress your video clips. Access keys are numeric codes that you insert into a video clip during compression. A clip encoded with an access key can be played only by an application that has the key. For example, Media Player* cannot play clips encoded with an access key because it cannot supply an access key to Indeo video 5. Other applications can supply access keys to Indeo video 5, but without the correct key code, the video does not play.

To enable the Access Key:

  1. Check the Enable box in the Access Key field. (The compression application displays the Value field.)
  2. Enter a number between 0 and 4,294,967,295 in the Value field. Do not type commas. (We recommend the use of relatively large numbers, to make the codes more difficult to guess).

This value is the code that an application or user must supply in order to play the video clip.

Viewport Size
The Viewport Size provides the offline encoder with information it needs to encode video sequences using the Indeo video 5's Local-Decode feature. Local Decode allows an application to display only part of a video image while playing back. It's more efficient not to decode the parts of the source image that are not needed for display. Indeo video 5 provides this capability with its Local Decode capability. The playback application can tell Indeo video 5 to decode only a rectangular subregion of the source video image called the viewport. If you plan to use this feature, specify the minimum possible size of the local decode viewport during compression. Then the display size of the viewport, and its location, can be changed dynamically during playback.

To enable local decode:
Specify the viewport size by selecting the appropriate size from the list box. The appropriate value is the one that is approximately the size of the smallest viewports your application will be using during playback. If your viewports are long and thin in either direction, then choose the viewport size setting that most closely matches the longest side of your smallest viewport.

To disable local decode:
Select "None" in the viewport size list box.

NOTE: Local Decode is disabled when using the quick compressor.

Editing Compressed Video

It's best to avoid editing compressed material, but if you must edit a compressed file, use an application like Asymetrix's Digital Video Producer or Adobe Premiere, which supports limited recompression. They recompress only the part of the file that has been modified.

For example, suppose you'd like to extract a sequence in which the first frame is a delta frame. The application must decompress the first frame and recompress it as a key frame, using the previous key frame from the source file as a reference. All subsequent delta frames until the next key frame must also be decompressed and recompressed as new delta frames, using the newly-created key frame as a reference. But as soon as the next key frame is encountered, no further frames need to be recompressed, and applications that support limited recompression avoid doing so.

NOTE: Certain editing applications, like Adobe Premiere and Asymetrix's Digital Video Producer, do not have an explicit No Recompression option in the Compression dialog box. To avoid recompressing Indeo video source files, for example, select the same Indeo video codec when saving those files back to disk. The application compares the format of the compressed input files to the selected output format and automatically refrains from recompressing the data, or recompresses only when necessary.

Finally, it's a good idea to avoid joining files compressed in different formats into one clip. For example, if you join a file compressed using Indeo video with a file compressed using Microsoft's RLE* compressor, and select Indeo video as the save format, the RLE data must be decompressed and recompressed as Indeo video. Avoiding recompression is impossible under these circumstances.

Using Transparency without Application Support

Some video editing and compression applications do not yet support Indeo video 5's transparency feature. If you are using such an application, you can still create .AVI files with transparency. This section describes the necessary workarounds to incorporate transparency.

Incorporating Transparency without Application Support: Problem and Workaround

To create a video file with transparency using an application that doesn't support transparency, you can use a first frame analysis technique. Using this technique, the first frame of the video file is created as a "dummy" frame with the sole purpose of supplying the color to be rendered as transparent in the compressed video file. This frame, which contains no video data other than the background color, is called the transparency frame (TF). As an example, take a video file containing 100 frames of video data, as shown in Figure 4.

Figure 4. Example Video File Without Transparency Frame


You must now create a frame that contains only the background color or range of colors that are to be rendered transparent, then paste it manually onto the beginning of the file. You can create the transparency frame in various ways; for example, by placing the video camera on a tripod, lighting your background as carefully as possible to produce the smallest possible range of colors, and shooting one frame of video. Another method that can be done after the video shoot is to export one of the actual video frames from your video file to an image editor, and erase all of the pixels that are not part of the background, replacing them with background colored pixels. After pasting in the transparency frame, your file appears as shown in Figure 5.

Figure 5. Example Video File With Transparency Frame


Ideally, the Indeo video 5 encoder would not return the transparency frame to the editing application. However, Video for Windows codecs are required to return one compressed frame for every source frame they are given. So even though you don't want the compressed file to play the transparency frame first, the Indeo video 5 encoder must return it.

Editing software enhanced to support the Indeo video 5 codec ignores the transparency frame, and does not write it to the output file. An editor that is not enhanced to support the Indeo video 5 codec may pair the transparency frame with the first frame of the audio, and write the audio and video data as an .AVI frame. After this initial mispairing, the first frame of video is paired with the second frame of audio, the second frame of video with the third frame of audio, and so on. The resulting file has 101 frames of video but only one hundred frames of audio. The audio and video are out of sync by one frame.

In most video-editing software, this problem can be avoided by ensuring that the beginning of the audio is aligned with the second frame of video (the first frame after the transparency frame). In any case, if your editing application does not know about Indeo video 5 transparency, you will want to remove the first frame of the video.

To use First frame Analysis:

  1. Compress the file using the Indeo video 5 codec.
  2. Choose the transparency setting first frame analysis in the Indeo video 5 advanced dialog box.
  3. Reopen the file in the editing application.
  4. Trim the first frame of the video, but not of the audio.
  5. Save the file without recompression.

The codec always returns the transparency frame as a key frame, and the actual first frame of video is also a key frame. After you delete the transparency frame, the file still starts with a key frame and can be saved without causing recompression.

Conclusion

Selecting the appropriate options when compressing video to be downloaded from a Web site or played from a CD-ROM is important to achieving good quality.

General Points

Web site videos for downloading (including Progressive Download)

Web site videos for streaming

CD-ROM Videos



To top of page
* Legal Information © 1998 Intel Corporation